<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: 树堆</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">数据结构</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#typedef-members">类型定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<h1>树堆</h1>  </div>
<div class="ingroups"><a class="el" href="group___xE4_xBA_x8C_xE5_x8F_x89_xE6_xA0_x91.html">二叉树</a></div></div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
数据结构</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct____treaplnk__node.html">__treaplnk_node</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">树堆节点  <a href="struct____treaplnk__node.html#_details">更多...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">树根  <a href="structtreaplnk__root.html#_details">更多...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtreaplnk__info.html">treaplnk_info</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">树信息表  <a href="structtreaplnk__info.html#_details">更多...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
宏定义</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae43b34feae059ffecefd491a89bc7f09">TREAPLNK_ROOT</a>(name)&#160;&#160;&#160;<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> name = {NULL}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">定义一个名为name的树根，并对其初始化  <a href="#gae43b34feae059ffecefd491a89bc7f09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4ab24c4e62e36e89e27f8d7a4fa3149b">TREAPLNK_NODE</a>(name)&#160;&#160;&#160;<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> name = {NULL, NULL, NULL, 0}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">定义一个名为name的节点，并对其初始化  <a href="#ga4ab24c4e62e36e89e27f8d7a4fa3149b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga7d3bd03455d4ac4b07695da1561ac52d">TREAPLNK_INFO</a>(name)&#160;&#160;&#160;<a class="el" href="structtreaplnk__info.html">treaplnk_info</a> name = {0, 0, 0}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">定义一个名为name的树信息表，并对其初始化  <a href="#ga7d3bd03455d4ac4b07695da1561ac52d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2b8d6bb9789641ed54d971da2f4d7976"></a><!-- doxytag: member="树堆::treaplnk_inc" ref="ga2b8d6bb9789641ed54d971da2f4d7976" args="(itr)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2b8d6bb9789641ed54d971da2f4d7976">treaplnk_inc</a>(itr)&#160;&#160;&#160;((itr) = treaplnk_next(itr))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">迭代器递增 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga49e38700e1a751927091febf09c6f1dc"></a><!-- doxytag: member="树堆::treaplnk_dec" ref="ga49e38700e1a751927091febf09c6f1dc" args="(itr)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga49e38700e1a751927091febf09c6f1dc">treaplnk_dec</a>(itr)&#160;&#160;&#160;((itr) = treaplnk_prev(itr))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">迭代器递减 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa17763173a4fb80564079a86cc9f7eca"></a><!-- doxytag: member="树堆::treaplnk_inc_later" ref="gaa17763173a4fb80564079a86cc9f7eca" args="(itr)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaa17763173a4fb80564079a86cc9f7eca">treaplnk_inc_later</a>(itr)&#160;&#160;&#160;__treaplnk_inc_later(itr, &amp;(itr))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">迭代器后自增 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga374159c0572248286e172bd53a90b96c"></a><!-- doxytag: member="树堆::treaplnk_dec_later" ref="ga374159c0572248286e172bd53a90b96c" args="(itr)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga374159c0572248286e172bd53a90b96c">treaplnk_dec_later</a>(itr)&#160;&#160;&#160;__treaplnk_dec_later(itr, &amp;(itr))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">迭代器后自减 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga8837c939518ae0edb8a0dc9325a0692c">treaplnk_foreach</a>(_begin, _end, fn, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">正向遍历_begin到_end的节点，并为每一个节点调用回调函数或宏  <a href="#ga8837c939518ae0edb8a0dc9325a0692c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga676ec355adc879995dfcaa2d08ef9b53">treaplnk_reverse_foreach</a>(_rbegin, _rend, fn, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">逆向遍历_begin到_end的节点，并为每一个节点调用回调函数或宏  <a href="#ga676ec355adc879995dfcaa2d08ef9b53"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga8f36380b2f733d0e16a5e99b3058c6e6">TREAPLNK_RECURSE_PROC</a>(name, type, param)&#160;&#160;&#160;void name(type * param)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">定义递归遍历回调函数  <a href="#ga8f36380b2f733d0e16a5e99b3058c6e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2e08d0567b5bebd37192d2997c05f7a6">treaplnk_recurse_foreach</a>(root, fn, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">正向递归遍历整个树  <a href="#ga2e08d0567b5bebd37192d2997c05f7a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2954703560aba06e10390cecd55ce874">treaplnk_recurse_reverse_foreach</a>(root, fn, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">逆向递归遍历整个树  <a href="#ga2954703560aba06e10390cecd55ce874"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gace2efa644b7ebd855208b023d9e298d1">treaplnk_search</a>(root, newly, greater, res, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">搜索树中的某个节点  <a href="#gace2efa644b7ebd855208b023d9e298d1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0596a3dbc9f19ed80f25ed406590539a">treaplnk_insert</a>(root, newly, greater, res, type, member)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">插入新节点  <a href="#ga0596a3dbc9f19ed80f25ed406590539a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad43d55a99cb69cce140b881eac510614">treaplnk_serialize</a>(root, buf, type, member)&#160;&#160;&#160;__treaplnk_serialize(root, (void**)(buf), offset_of(type, member))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">将树进行序列化为一个有序序列  <a href="#gad43d55a99cb69cce140b881eac510614"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bc92914978fa2ad835fe250bbaad8c">treaplnk_deserialize</a>(root, buf, cnt, type, member)&#160;&#160;&#160;__treaplnk_deserialize(root, (char**)(buf), cnt, offset_of(type, member))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">根据树的序列进行反序列化为一个完整的树  <a href="#ga69bc92914978fa2ad835fe250bbaad8c"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
类型定义</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf6b43fa9ed65d27786f3d63b27d5b783"></a><!-- doxytag: member="树堆::treaplnk_node" ref="gaf6b43fa9ed65d27786f3d63b27d5b783" args="" -->
typedef struct <a class="el" href="struct____treaplnk__node.html">__treaplnk_node</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf6b43fa9ed65d27786f3d63b27d5b783">treaplnk_node</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">节点 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4b4308fba0d58f5079b69ba269bacb01"></a><!-- doxytag: member="树堆::treaplnk_iter" ref="ga4b4308fba0d58f5079b69ba269bacb01" args="" -->
typedef struct <a class="el" href="struct____treaplnk__node.html">__treaplnk_node</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4b4308fba0d58f5079b69ba269bacb01">treaplnk_iter</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">迭代器 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga12473c60d17919848883f04bfa09a5a5"></a><!-- doxytag: member="树堆::treaplnk_pr1" ref="ga12473c60d17919848883f04bfa09a5a5" args=")(treaplnk_node *)" -->
typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12473c60d17919848883f04bfa09a5a5">treaplnk_pr1</a> )(<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">单参数回调函数指针 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaafa3ea646d74cd8a0b8bb71ab2b727d7"></a><!-- doxytag: member="树堆::treaplnk_pr2" ref="gaafa3ea646d74cd8a0b8bb71ab2b727d7" args=")(treaplnk_node *, treaplnk_node *)" -->
typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaafa3ea646d74cd8a0b8bb71ab2b727d7">treaplnk_pr2</a> )(<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *, <a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">双参数回调函数指针 <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
函数</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad66cce0995090f8ff4e255e45d83e927">treaplnk_count</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取树的节点总数  <a href="#gad66cce0995090f8ff4e255e45d83e927"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4dbe3b5512bf8d6407cef0ff821d316c">treaplnk_distance</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> first, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> last)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">计算两个节点的迭代距离  <a href="#ga4dbe3b5512bf8d6407cef0ff821d316c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga45104dc4d6a3c99f0ca6adb26a1ba60b">treaplnk_index_of</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> itr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">计算迭代器的正向索引  <a href="#ga45104dc4d6a3c99f0ca6adb26a1ba60b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae3d748d30e5da2583bb3bc3b12ca68db">treaplnk_reverse_index_of</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> itr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">计算迭代器的逆向索引  <a href="#gae3d748d30e5da2583bb3bc3b12ca68db"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bd6cd659eb01cee33b211cc5883fab">treaplnk_depth</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">计算树的深度  <a href="#ga69bd6cd659eb01cee33b211cc5883fab"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0e528fc27a6476cf7cac10305a4bc191">treaplnk_leafs</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">计算树的叶子数  <a href="#ga0e528fc27a6476cf7cac10305a4bc191"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac1c3d37dd05e4d469eff62eebc4bb483">treaplnk_get_info</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="structtreaplnk__info.html">treaplnk_info</a> *info)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取树的信息，包括节点数、深度、叶子数  <a href="#gac1c3d37dd05e4d469eff62eebc4bb483"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaae88f9f0194b5721af46c65d5dea2078">treaplnk_fix</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node, <a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *parent)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">修正树  <a href="#gaae88f9f0194b5721af46c65d5dea2078"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gafdefc8690af7387b1f376247e69b9ad7">treaplnk_erase</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *entry)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">移除某个节点  <a href="#gafdefc8690af7387b1f376247e69b9ad7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0157ffea5e9b1a9d9bd903d8c6a518d8">treaplnk_erases</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> begin, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> end, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12473c60d17919848883f04bfa09a5a5">treaplnk_pr1</a> erase_handler)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">移除区域内的节点  <a href="#ga0157ffea5e9b1a9d9bd903d8c6a518d8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac7e32a548f651a2b676985202b54e661">treaplnk_init</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化树根  <a href="#gac7e32a548f651a2b676985202b54e661"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga96e53af6fe7142244a05e80bce0b3eb0">treaplnk_empty</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断树是否为空  <a href="#ga96e53af6fe7142244a05e80bce0b3eb0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga553084764927049b0831fac0c19a7580"></a><!-- doxytag: member="树堆::__treaplnk_singular" ref="ga553084764927049b0831fac0c19a7580" args="(treaplnk_node *root)" -->
static int&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_singular</b> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *root)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad66345b9a303383b3df2c5028d86f1f9">treaplnk_singular</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断树是否只有单个节点  <a href="#gad66345b9a303383b3df2c5028d86f1f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0633509d7f4416a090815f50a95a7a63">treaplnk_serialable</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断树是否可以序列化  <a href="#ga0633509d7f4416a090815f50a95a7a63"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga358134910aadd9d7580dbf0fed03bc31">treaplnk_left</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到左子节点  <a href="#ga358134910aadd9d7580dbf0fed03bc31"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga055771881b33a6f1b5c69c8fd0177c1e">treaplnk_right</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到右子节点  <a href="#ga055771881b33a6f1b5c69c8fd0177c1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gafd4f501b5392c966d7f7ccb6253ec465">treaplnk_parent</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到父节点  <a href="#gafd4f501b5392c966d7f7ccb6253ec465"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga1f4ff7046c020cd7a83d88fc43f4da18">treaplnk_priority</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到节点的优先权  <a href="#ga1f4ff7046c020cd7a83d88fc43f4da18"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaeb5c0d6ab3522c1816b6834675be2828">treaplnk_is_root</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> itr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断当前节点是否是根节点  <a href="#gaeb5c0d6ab3522c1816b6834675be2828"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae0ca77682f8559c79d5dc71bbc07756e">treaplnk_is_leaf</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> itr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断当前节点是否是叶子节点  <a href="#gae0ca77682f8559c79d5dc71bbc07756e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga33f96e3db43b13c620d9ecf47be03418">treaplnk_link</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> newly, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> parent, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> *plink)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">链接两个节点  <a href="#ga33f96e3db43b13c620d9ecf47be03418"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaeb412c8138afd90d9d2e271b641c52ac">treaplnk_set_priority</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node, size_t priority)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">设置当前节点的优先权  <a href="#gaeb412c8138afd90d9d2e271b641c52ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga603045fe815f3b650f3086b3747bb6a9">treaplnk_set_parent_if</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node, <a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *parent)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">仅在node不为空时，设置node的父节点  <a href="#ga603045fe815f3b650f3086b3747bb6a9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae3353c18c25b1b4c315a2407f2499b59">treaplnk_node_init</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *node)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化节点  <a href="#gae3353c18c25b1b4c315a2407f2499b59"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga10f0160bf916bb920848d908af696f17">treaplnk_iter_replace</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> victim, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> newly)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">用新节点替换旧节点  <a href="#ga10f0160bf916bb920848d908af696f17"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf149eeeee5ce68eab7d07287ecc1f43b">treaplnk_replace</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *victim, <a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *newly)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">用新的树根替换旧树根  <a href="#gaf149eeeee5ce68eab7d07287ecc1f43b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gafd4471880ecdda0e76f9f6ca214805a6">treaplnk_swap</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *a, <a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *b)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">交换两个树  <a href="#gafd4471880ecdda0e76f9f6ca214805a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4cb4d2e7f6c2518f504eaee046450c4c">treaplnk_exist</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> itr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">判断一个节点是否存在于树中  <a href="#ga4cb4d2e7f6c2518f504eaee046450c4c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga9961c3e28ad5d8bf2e1c599f0f0c0886">treaplnk_at</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, size_t index)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到正向索引对应的节点的迭代器  <a href="#ga9961c3e28ad5d8bf2e1c599f0f0c0886"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae10f61d50563cd0731692ce8b1ab0cbb">treaplnk_reverse_at</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, size_t index)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到逆向索引对应的节点的迭代器  <a href="#gae10f61d50563cd0731692ce8b1ab0cbb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga912adb278fdbb3938e29e0bcf2f58c6e">treaplnk_front</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到树的最左端节点  <a href="#ga912adb278fdbb3938e29e0bcf2f58c6e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2215902aa2d70496fccdb14fcf8da0ce">treaplnk_back</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到树的最右端节点  <a href="#ga2215902aa2d70496fccdb14fcf8da0ce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf5df84d890ae7dc07c210fead0d826ec">treaplnk_begin</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到指向正向起始位置的迭代器  <a href="#gaf5df84d890ae7dc07c210fead0d826ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad590259a18b3e07fde596e1cd7dd135f">treaplnk_end</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到指向正向终止位置的迭代器  <a href="#gad590259a18b3e07fde596e1cd7dd135f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12c517e1858f21365e26e5217ccb45af">treaplnk_end_of</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到当前迭代器的正向终止位置  <a href="#ga12c517e1858f21365e26e5217ccb45af"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaaf3b3ffd977431ffbe9d7e24ee09e9e9">treaplnk_rbegin</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到指向逆向起始位置的迭代器  <a href="#gaaf3b3ffd977431ffbe9d7e24ee09e9e9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaab7748cacfeacd6f160350c2f37d89bf">treaplnk_rend</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到指向逆向终止位置的迭代器  <a href="#gaab7748cacfeacd6f160350c2f37d89bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2a2dcd287fdd62bdd0d9cbbf60caeb60">treaplnk_rend_of</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到当前迭代器的逆向终止位置  <a href="#ga2a2dcd287fdd62bdd0d9cbbf60caeb60"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4ef2c4a4f07589b1dae6b47c09ce790a">treaplnk_next</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到当前节点的中序后继节点  <a href="#ga4ef2c4a4f07589b1dae6b47c09ce790a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gacdde57d39d567fc2b5dbc661f67bef08">treaplnk_prev</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">得到当前节点的中序前驱节点  <a href="#gacdde57d39d567fc2b5dbc661f67bef08"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga71d356704e6ae0fd1b686ac10fce28eb">treaplnk_advance</a> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur, int dist)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">给迭代器增加一段距离或减小一段距离  <a href="#ga71d356704e6ae0fd1b686ac10fce28eb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gadfbee5eebd305e1c30dcfc00b536dbfb">treaplnk_clear</a> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12473c60d17919848883f04bfa09a5a5">treaplnk_pr1</a> erase_handler)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">清空树  <a href="#gadfbee5eebd305e1c30dcfc00b536dbfb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3e851c80f6d2d057f292a71027f5b3a9"></a><!-- doxytag: member="树堆::__treaplnk_inc_later" ref="ga3e851c80f6d2d057f292a71027f5b3a9" args="(treaplnk_iter cur, treaplnk_iter *p)" -->
static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_inc_later</b> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> *p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga86c26306f59b70c5b518059fffc6a00d"></a><!-- doxytag: member="树堆::__treaplnk_dec_later" ref="ga86c26306f59b70c5b518059fffc6a00d" args="(treaplnk_iter cur, treaplnk_iter *p)" -->
static <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_dec_later</b> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur, <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> *p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafd6c08f1fb1b1ae2936b5aca6dd00fe1"></a><!-- doxytag: member="树堆::__do_treaplnk_recurse_foreach" ref="gafd6c08f1fb1b1ae2936b5aca6dd00fe1" args="(treaplnk_iter cur, void(*fn)(void *), size_t offset)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__do_treaplnk_recurse_foreach</b> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur, void(*fn)(void *), size_t offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1b326be7338045a913f6b08e3b80e1c7"></a><!-- doxytag: member="树堆::__do_treaplnk_recurse_reverse_foreach" ref="ga1b326be7338045a913f6b08e3b80e1c7" args="(treaplnk_iter cur, void(*fn)(void *), size_t offset)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__do_treaplnk_recurse_reverse_foreach</b> (<a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> cur, void(*fn)(void *), size_t offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6040bfe966b46c26c766cd51d69c819d"></a><!-- doxytag: member="树堆::__treaplnk_recurse_foreach" ref="ga6040bfe966b46c26c766cd51d69c819d" args="(treaplnk_root *root, void(*fn)(void *), size_t offset)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_recurse_foreach</b> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, void(*fn)(void *), size_t offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6f61a077b50d5ecd4e2410496e51c05e"></a><!-- doxytag: member="树堆::__treaplnk_recurse_reverse_foreach" ref="ga6f61a077b50d5ecd4e2410496e51c05e" args="(treaplnk_root *root, void(*fn)(void *), size_t offset)" -->
static void&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_recurse_reverse_foreach</b> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, void(*fn)(void *), size_t offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga617460e11f3567b4b6d2f6b775a4f79f"></a><!-- doxytag: member="树堆::__treaplnk_serialize" ref="ga617460e11f3567b4b6d2f6b775a4f79f" args="(treaplnk_root *root, void **buf, size_t offset)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_serialize</b> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, void **buf, size_t offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga391443a36ebc4ad789811f0f897acaae"></a><!-- doxytag: member="树堆::__treaplnk_deserialize" ref="ga391443a36ebc4ad789811f0f897acaae" args="(treaplnk_root *root, char **buf, size_t cnt, size_t offset)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__treaplnk_deserialize</b> (<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *root, char **buf, size_t cnt, size_t offset)</td></tr>
</table>
<hr/><h2>宏定义文档</h2>
<a class="anchor" id="gae43b34feae059ffecefd491a89bc7f09"></a><!-- doxytag: member="treaplnk.h::TREAPLNK_ROOT" ref="gae43b34feae059ffecefd491a89bc7f09" args="(name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TREAPLNK_ROOT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="structtreaplnk__root.html">treaplnk_root</a> name = {NULL}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>定义一个名为name的树根，并对其初始化 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>树根名称 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00083">83</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga4ab24c4e62e36e89e27f8d7a4fa3149b"></a><!-- doxytag: member="treaplnk.h::TREAPLNK_NODE" ref="ga4ab24c4e62e36e89e27f8d7a4fa3149b" args="(name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TREAPLNK_NODE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> name = {NULL, NULL, NULL, 0}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>定义一个名为name的节点，并对其初始化 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>节点名称 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00084">84</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga7d3bd03455d4ac4b07695da1561ac52d"></a><!-- doxytag: member="treaplnk.h::TREAPLNK_INFO" ref="ga7d3bd03455d4ac4b07695da1561ac52d" args="(name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TREAPLNK_INFO</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="structtreaplnk__info.html">treaplnk_info</a> name = {0, 0, 0}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>定义一个名为name的树信息表，并对其初始化 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>名称 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00085">85</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga8837c939518ae0edb8a0dc9325a0692c"></a><!-- doxytag: member="treaplnk.h::treaplnk_foreach" ref="ga8837c939518ae0edb8a0dc9325a0692c" args="(_begin, _end, fn, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_foreach</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_begin, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_end, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fn, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {\
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _q_e = (_end);                        \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _q_f = (_begin);                      \
        <span class="keywordflow">while</span> (_q_f != _q_e) {                              \
            type * _q_t = container_of(_q_f, type, member); \
            <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2b8d6bb9789641ed54d971da2f4d7976" title="迭代器递增">treaplnk_inc</a>(_q_f);                             \
            fn(_q_t);                                       \
        }                                                   \
    } <span class="keywordflow">while</span> (0)
</pre></div>
<p>正向遍历_begin到_end的节点，并为每一个节点调用回调函数或宏 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">_begin</td><td>起始位置 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">_end</td><td>终止位置 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fn</td><td>回调函数或宏 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00719">719</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga676ec355adc879995dfcaa2d08ef9b53"></a><!-- doxytag: member="treaplnk.h::treaplnk_reverse_foreach" ref="ga676ec355adc879995dfcaa2d08ef9b53" args="(_rbegin, _rend, fn, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_reverse_foreach</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_rbegin, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">_rend, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fn, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {\
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _q_e = (_rend);                       \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _q_f = (_rbegin);                     \
        <span class="keywordflow">while</span> (_q_f != _q_e) {                              \
            type * _q_t = container_of(_q_f, type, member); \
            <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga49e38700e1a751927091febf09c6f1dc" title="迭代器递减">treaplnk_dec</a>(_q_f);                             \
            fn(_q_t);                                       \
        }                                                   \
    } <span class="keywordflow">while</span> (0)
</pre></div>
<p>逆向遍历_begin到_end的节点，并为每一个节点调用回调函数或宏 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">_rbegin</td><td>逆向起始位置 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">_rend</td><td>逆向终止位置 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fn</td><td>回调函数或宏 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00738">738</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga8f36380b2f733d0e16a5e99b3058c6e6"></a><!-- doxytag: member="treaplnk.h::TREAPLNK_RECURSE_PROC" ref="ga8f36380b2f733d0e16a5e99b3058c6e6" args="(name, type, param)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TREAPLNK_RECURSE_PROC</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">param&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;void name(type * param)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>定义递归遍历回调函数 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>函数名 </td></tr>
    <tr><td class="paramname">type</td><td>节点拥有者类型 </td></tr>
    <tr><td class="paramname">param</td><td>参数名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2e08d0567b5bebd37192d2997c05f7a6" title="正向递归遍历整个树">treaplnk_recurse_foreach</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2954703560aba06e10390cecd55ce874" title="逆向递归遍历整个树">treaplnk_recurse_reverse_foreach</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00776">776</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga2e08d0567b5bebd37192d2997c05f7a6"></a><!-- doxytag: member="treaplnk.h::treaplnk_recurse_foreach" ref="ga2e08d0567b5bebd37192d2997c05f7a6" args="(root, fn, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_recurse_foreach</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fn, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment">__treaplnk_recurse_foreach(root, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span>*))(fn), \
            offset_of(type, member))
</pre></div>
<p>正向递归遍历整个树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fn</td><td>回调函数或宏 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga8f36380b2f733d0e16a5e99b3058c6e6" title="定义递归遍历回调函数">TREAPLNK_RECURSE_PROC</a>(PrintNode, DATA, node)
    {
        printf(<span class="stringliteral">&quot;%3d &quot;</span>, node-&gt;data);
    }

    <span class="comment">// 打印整个树</span>
    <span class="keywordtype">void</span> PrintAVLTree(<a class="code" href="structtreaplnk__root.html" title="树根">treaplnk_root</a>* root)
    {
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2e08d0567b5bebd37192d2997c05f7a6" title="正向递归遍历整个树">treaplnk_recurse_foreach</a>(root, PrintNode, DATA, node);
        putchar(<span class="charliteral">&#39;\n&#39;</span>);
    }
</pre></div> </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2954703560aba06e10390cecd55ce874" title="逆向递归遍历整个树">treaplnk_recurse_reverse_foreach</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga8f36380b2f733d0e16a5e99b3058c6e6" title="定义递归遍历回调函数">TREAPLNK_RECURSE_PROC</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00801">801</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga2954703560aba06e10390cecd55ce874"></a><!-- doxytag: member="treaplnk.h::treaplnk_recurse_reverse_foreach" ref="ga2954703560aba06e10390cecd55ce874" args="(root, fn, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_recurse_reverse_foreach</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fn, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment">__treaplnk_recurse_reverse_foreach(root, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span>*))(fn), \
            offset_of(type, member))
</pre></div>
<p>逆向递归遍历整个树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fn</td><td>回调函数或宏 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2e08d0567b5bebd37192d2997c05f7a6" title="正向递归遍历整个树">treaplnk_recurse_foreach</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga8f36380b2f733d0e16a5e99b3058c6e6" title="定义递归遍历回调函数">TREAPLNK_RECURSE_PROC</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00814">814</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gace2efa644b7ebd855208b023d9e298d1"></a><!-- doxytag: member="treaplnk.h::treaplnk_search" ref="gace2efa644b7ebd855208b023d9e298d1" args="(root, newly, greater, res, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_search</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">newly, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">greater, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">res, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {\
        <a class="code" href="structtreaplnk__root.html" title="树根">treaplnk_root</a>* _k_r = (root);                           \
        type * _k_pn = (newly);                                 \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _k_p = _k_r-&gt;<a class="code" href="structtreaplnk__root.html#a0c7711a1496b39126279c2b9285a24ed" title="根节点">node</a>;                        \
        (res) = NULL;                                           \
        <span class="keywordflow">while</span> (_k_p) {                                          \
            type * _k_pr = container_of(_k_p, type, member);    \
            <span class="keywordflow">if</span> (greater(_k_pr, _k_pn))                          \
                _k_p = _k_p-&gt;<a class="code" href="struct____treaplnk__node.html#aaabd7a688dedb620c93809d069cb5906" title="左子节点">left</a>;                              \
            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (greater(_k_pn, _k_pr))                     \
                _k_p = _k_p-&gt;<a class="code" href="struct____treaplnk__node.html#a1878af8228914890446ad2f0cebcf10c" title="右子节点">right</a>;                             \
            <span class="keywordflow">else</span> {                                              \
                (res) = _k_p; <span class="keywordflow">break</span>;                            \
            }                                                   \
        }                                                       \
    } <span class="keywordflow">while</span> (0)
</pre></div>
<p>搜索树中的某个节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">newly</td><td>用于搜索的临时节点，类型是type，该节点使用与搜索的值相同的值 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">greater</td><td>比较函数或宏。 升序:(i-&gt;data &gt; j-&gt;data) 降序:(i-&gt;data &lt; j-&gt;data) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">res</td><td>返回值。返回目标节点，若为NULL表示找不到节点 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> node_15;
    DATA* p = (DATA*)malloc(<span class="keyword">sizeof</span>(DATA));
    <span class="keywordflow">if</span> (!p)
        <span class="keywordflow">return</span> NULL;

    p-&gt;data = 15;

    <span class="comment">//查找值为15的节点</span>
    <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gace2efa644b7ebd855208b023d9e298d1" title="搜索树中的某个节点">treaplnk_search</a>(&amp;root, p, DATA_Greater, node_15, DATA, node);
    <span class="keywordflow">if</span> (!node_15)
        <span class="keywordflow">return</span> NULL;

    <span class="keywordflow">return</span> node_15;
</pre></div> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00846">846</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga0596a3dbc9f19ed80f25ed406590539a"></a><!-- doxytag: member="treaplnk.h::treaplnk_insert" ref="ga0596a3dbc9f19ed80f25ed406590539a" args="(root, newly, greater, res, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_insert</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">newly, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">greater, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">res, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>值:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {\
        <a class="code" href="structtreaplnk__root.html" title="树根">treaplnk_root</a>* _k_r = (root);                                   \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a>* _k_pp = &amp;_k_r-&gt;<a class="code" href="structtreaplnk__root.html#a0c7711a1496b39126279c2b9285a24ed" title="根节点">node</a>;                             \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _k_n = (newly);                                   \
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> _k_p;                                             \
        type * _k_pn = container_of(_k_n, type, member);                \
        (res) = 1;                                                      \
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae3353c18c25b1b4c315a2407f2499b59" title="初始化节点">treaplnk_node_init</a>(_k_n);                                       \
        <span class="keywordflow">while</span> (*_k_pp) {                                                \
            type * _k_pr = container_of(_k_p = *_k_pp, type, member);   \
            <span class="keywordflow">if</span> (greater(_k_pr, _k_pn))                                  \
                _k_pp = &amp;_k_p-&gt;<a class="code" href="struct____treaplnk__node.html#aaabd7a688dedb620c93809d069cb5906" title="左子节点">left</a>;                                    \
            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (greater(_k_pn, _k_pr))                             \
                _k_pp = &amp;_k_p-&gt;<a class="code" href="struct____treaplnk__node.html#a1878af8228914890446ad2f0cebcf10c" title="右子节点">right</a>;                                   \
            <span class="keywordflow">else</span> {                                                      \
                (res) = 0; <span class="keywordflow">break</span>;                                       \
            }                                                           \
        }                                                               \
        <span class="keywordflow">if</span> (res) {                                                      \
            <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga33f96e3db43b13c620d9ecf47be03418" title="链接两个节点">treaplnk_link</a>(_k_n, _k_p, _k_pp);                           \
            <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaae88f9f0194b5721af46c65d5dea2078" title="修正树">treaplnk_fix</a>(_k_r, _k_n, _k_p);                             \
        }                                                               \
    } <span class="keywordflow">while</span> (0)
</pre></div>
<p>插入新节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">newly</td><td>新节点 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">greater</td><td>比较函数或宏。 升序:(i-&gt;data &gt; j-&gt;data) 降序:(i-&gt;data &lt; j-&gt;data) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">res</td><td>返回值。返回1表示成功；若为0表示节点有冲突，无法插入 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <span class="keywordtype">int</span> ret;
    DATA* p = (DATA*)malloc(<span class="keyword">sizeof</span>(DATA));
    <span class="keywordflow">if</span> (!p)
        <span class="keywordflow">return</span> 0;

    p-&gt;data = 88;

    <span class="comment">//插入值为88的节点</span>
    <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0596a3dbc9f19ed80f25ed406590539a" title="插入新节点">treaplnk_insert</a>(&amp;root, &amp;p-&gt;node, DATA_Greater, ret, DATA, node);
    <span class="keywordflow">if</span> (!ret)
        <span class="keywordflow">return</span> 0;

    <span class="keywordflow">return</span> 1;
</pre></div> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00891">891</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gad43d55a99cb69cce140b881eac510614"></a><!-- doxytag: member="treaplnk.h::treaplnk_serialize" ref="gad43d55a99cb69cce140b881eac510614" args="(root, buf, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_serialize</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;__treaplnk_serialize(root, (void**)(buf), offset_of(type, member))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>将树进行序列化为一个有序序列 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>序列缓存，元素类型为type指针类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bc92914978fa2ad835fe250bbaad8c" title="根据树的序列进行反序列化为一个完整的树">treaplnk_deserialize</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0633509d7f4416a090815f50a95a7a63" title="判断树是否可以序列化">treaplnk_serialable</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00930">930</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga69bc92914978fa2ad835fe250bbaad8c"></a><!-- doxytag: member="treaplnk.h::treaplnk_deserialize" ref="ga69bc92914978fa2ad835fe250bbaad8c" args="(root, buf, cnt, type, member)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define treaplnk_deserialize</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">root, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">cnt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">member&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;__treaplnk_deserialize(root, (char**)(buf), cnt, offset_of(type, member))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>根据树的序列进行反序列化为一个完整的树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>序列缓存，元素类型为type指针类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cnt</td><td>序列长度(元素数) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>拥有者类型 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">member</td><td>所在成员名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad43d55a99cb69cce140b881eac510614" title="将树进行序列化为一个有序序列">treaplnk_serialize</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0633509d7f4416a090815f50a95a7a63" title="判断树是否可以序列化">treaplnk_serialable</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00943">943</a>行定义。</p>

</div>
</div>
<hr/><h2>函数文档</h2>
<a class="anchor" id="gad66cce0995090f8ff4e255e45d83e927"></a><!-- doxytag: member="treaplnk.h::treaplnk_count" ref="gad66cce0995090f8ff4e255e45d83e927" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_count </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取树的节点总数 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回节点数 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac1c3d37dd05e4d469eff62eebc4bb483" title="获取树的信息，包括节点数、深度、叶子数">treaplnk_get_info</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00357">357</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga4dbe3b5512bf8d6407cef0ff821d316c"></a><!-- doxytag: member="treaplnk.h::treaplnk_distance" ref="ga4dbe3b5512bf8d6407cef0ff821d316c" args="(treaplnk_iter first, treaplnk_iter last)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_distance </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>last</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>计算两个节点的迭代距离 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>首节点 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>尾节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>以索引为例，2到4的距离是4 (4-2+1=3) </dd></dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回距离 </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00370">370</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga45104dc4d6a3c99f0ca6adb26a1ba60b"></a><!-- doxytag: member="treaplnk.h::treaplnk_index_of" ref="ga45104dc4d6a3c99f0ca6adb26a1ba60b" args="(treaplnk_root *root, treaplnk_iter itr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_index_of </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>itr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>计算迭代器的正向索引 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>迭代器 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回索引 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae3d748d30e5da2583bb3bc3b12ca68db" title="计算迭代器的逆向索引">treaplnk_reverse_index_of</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00383">383</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gae3d748d30e5da2583bb3bc3b12ca68db"></a><!-- doxytag: member="treaplnk.h::treaplnk_reverse_index_of" ref="gae3d748d30e5da2583bb3bc3b12ca68db" args="(treaplnk_root *root, treaplnk_iter itr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_reverse_index_of </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>itr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>计算迭代器的逆向索引 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>迭代器 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回索引 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga45104dc4d6a3c99f0ca6adb26a1ba60b" title="计算迭代器的正向索引">treaplnk_index_of</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00396">396</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga69bd6cd659eb01cee33b211cc5883fab"></a><!-- doxytag: member="treaplnk.h::treaplnk_depth" ref="ga69bd6cd659eb01cee33b211cc5883fab" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_depth </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>计算树的深度 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回深度 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac1c3d37dd05e4d469eff62eebc4bb483" title="获取树的信息，包括节点数、深度、叶子数">treaplnk_get_info</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00240">240</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga0e528fc27a6476cf7cac10305a4bc191"></a><!-- doxytag: member="treaplnk.h::treaplnk_leafs" ref="ga0e528fc27a6476cf7cac10305a4bc191" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API size_t treaplnk_leafs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>计算树的叶子数 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>size_t 返回叶子数 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac1c3d37dd05e4d469eff62eebc4bb483" title="获取树的信息，包括节点数、深度、叶子数">treaplnk_get_info</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00281">281</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gac1c3d37dd05e4d469eff62eebc4bb483"></a><!-- doxytag: member="treaplnk.h::treaplnk_get_info" ref="gac1c3d37dd05e4d469eff62eebc4bb483" args="(treaplnk_root *root, treaplnk_info *info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API void treaplnk_get_info </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtreaplnk__info.html">treaplnk_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取树的信息，包括节点数、深度、叶子数 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">info</td><td>保存信息的结构体 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad66cce0995090f8ff4e255e45d83e927" title="获取树的节点总数">treaplnk_count</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bd6cd659eb01cee33b211cc5883fab" title="计算树的深度">treaplnk_depth</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0e528fc27a6476cf7cac10305a4bc191" title="计算树的叶子数">treaplnk_leafs</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00308">308</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaae88f9f0194b5721af46c65d5dea2078"></a><!-- doxytag: member="treaplnk.h::treaplnk_fix" ref="gaae88f9f0194b5721af46c65d5dea2078" args="(treaplnk_root *root, treaplnk_node *node, treaplnk_node *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API void treaplnk_fix </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>parent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>修正树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">node</td><td>目标节点 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">parent</td><td>node的父节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>常用于节点插入、节点优先权改变之后的调整 </dd></dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <span class="keywordtype">int</span> insert_node(<a class="code" href="structtreaplnk__root.html" title="树根">treaplnk_root</a>* root, DATA* newly)
    {
        DATA* pdat;
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a> cur;
        <a class="code" href="struct____treaplnk__node.html" title="树堆节点">treaplnk_iter</a>* p = &amp;root-&gt;<a class="code" href="structtreaplnk__root.html#a0c7711a1496b39126279c2b9285a24ed" title="根节点">node</a>;
        
        <span class="comment">// 初始化新节点</span>
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae3353c18c25b1b4c315a2407f2499b59" title="初始化节点">treaplnk_node_init</a>(&amp;newly-&gt;node);
        
        <span class="keywordflow">while</span> (*p) {
            cur = *p;
            pdat = container_of(cur, DATA, node);
            <span class="keywordflow">if</span> (pdat-&gt;data &gt; newly-&gt;data)
                p = &amp;cur-&gt;<a class="code" href="struct____treaplnk__node.html#aaabd7a688dedb620c93809d069cb5906" title="左子节点">left</a>;
            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pdat-&gt;data &lt; newly-&gt;data)
                p = &amp;cur-&gt;<a class="code" href="struct____treaplnk__node.html#a1878af8228914890446ad2f0cebcf10c" title="右子节点">right</a>;
            <span class="keywordflow">else</span> {
                <span class="comment">// 有相同值的节点，无法插入</span>
                <span class="keywordflow">return</span> 0;
            }
        }
        
        <span class="comment">// 链接新节点到树中</span>
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga33f96e3db43b13c620d9ecf47be03418" title="链接两个节点">treaplnk_link</a>(&amp;newly-&gt;node, cur, p);
        
        <span class="comment">// 修正树</span>
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaae88f9f0194b5721af46c65d5dea2078" title="修正树">treaplnk_fix</a>(root, &amp;newly-&gt;<a class="code" href="structtreaplnk__root.html#a0c7711a1496b39126279c2b9285a24ed" title="根节点">node</a>, cur);

        <span class="keywordflow">return</span> 1;
    }
</pre></div> </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0596a3dbc9f19ed80f25ed406590539a" title="插入新节点">treaplnk_insert</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga33f96e3db43b13c620d9ecf47be03418" title="链接两个节点">treaplnk_link</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00083">83</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gafdefc8690af7387b1f376247e69b9ad7"></a><!-- doxytag: member="treaplnk.h::treaplnk_erase" ref="gafdefc8690af7387b1f376247e69b9ad7" args="(treaplnk_root *root, treaplnk_node *entry)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API void treaplnk_erase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>entry</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>移除某个节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">entry</td><td>待移除节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00097">97</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga0157ffea5e9b1a9d9bd903d8c6a518d8"></a><!-- doxytag: member="treaplnk.h::treaplnk_erases" ref="ga0157ffea5e9b1a9d9bd903d8c6a518d8" args="(treaplnk_root *root, treaplnk_iter begin, treaplnk_iter end, treaplnk_pr1 erase_handler)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API void treaplnk_erases </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12473c60d17919848883f04bfa09a5a5">treaplnk_pr1</a>&#160;</td>
          <td class="paramname"><em>erase_handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>移除区域内的节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">root</td><td>树根</td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">begin</td><td>起始位置 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">end</td><td>终止位置 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">erase_handler</td><td>移除响应函数，通常用于监视和释放节点，可以传递NULL, 表示不为删除的节点调用响应来处理 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>函数会为每一个被移除的节点调用erase_handler来处理节点 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gadfbee5eebd305e1c30dcfc00b536dbfb" title="清空树">treaplnk_clear</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00130">130</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gac7e32a548f651a2b676985202b54e661"></a><!-- doxytag: member="treaplnk.h::treaplnk_init" ref="gac7e32a548f651a2b676985202b54e661" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>初始化树根 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">root</td><td>目标树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <a class="code" href="structtreaplnk__root.html" title="树根">treaplnk_root</a> r;
    <span class="comment">// 初始化</span>
    <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gac7e32a548f651a2b676985202b54e661" title="初始化树根">treaplnk_init</a>(&amp;r);
</pre></div> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00243">243</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga96e53af6fe7142244a05e80bce0b3eb0"></a><!-- doxytag: member="treaplnk.h::treaplnk_empty" ref="ga96e53af6fe7142244a05e80bce0b3eb0" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline int treaplnk_empty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断树是否为空 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>真 </td></tr>
    <tr><td class="paramname">0</td><td>假 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <span class="keywordflow">if</span> (!<a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga96e53af6fe7142244a05e80bce0b3eb0" title="判断树是否为空">treaplnk_empty</a>(&amp;r)) {
        ......
    }
</pre></div> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00262">262</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gad66345b9a303383b3df2c5028d86f1f9"></a><!-- doxytag: member="treaplnk.h::treaplnk_singular" ref="gad66345b9a303383b3df2c5028d86f1f9" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline int treaplnk_singular </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断树是否只有单个节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>真 </td></tr>
    <tr><td class="paramname">0</td><td>假 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <span class="keywordflow">if</span> (<a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad66345b9a303383b3df2c5028d86f1f9" title="判断树是否只有单个节点">treaplnk_singular</a>(&amp;r)) {
        ......
    }
</pre></div> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00286">286</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga0633509d7f4416a090815f50a95a7a63"></a><!-- doxytag: member="treaplnk.h::treaplnk_serialable" ref="ga0633509d7f4416a090815f50a95a7a63" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline int treaplnk_serialable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断树是否可以序列化 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>即判断是否至少有一个节点 </dd></dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>真 </td></tr>
    <tr><td class="paramname">0</td><td>假 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <span class="comment">// 判断是否可以序列化</span>
    <span class="keywordflow">if</span> (<a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0633509d7f4416a090815f50a95a7a63" title="判断树是否可以序列化">treaplnk_serialable</a>(&amp;r)) {
        <a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab7b8f6f20db0f3e5681fd2184b1ae60c" title="type类型表头">slseq_head</a> seq;
        <span class="comment">// 分配序列缓存</span>
        DATA** buf = (DATA**)malloc(<span class="keyword">sizeof</span>(DATA*) * avl_cnt);
        <span class="comment">// 序列化</span>
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad43d55a99cb69cce140b881eac510614" title="将树进行序列化为一个有序序列">treaplnk_serialize</a>(&amp;r, buf, DATA, node);
        <a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga08213d0c7bcf381b466b18e3822c6934" title="初始化序列">SLSEQ_INIT_SERIAL</a>(&amp;seq, buf, avl_cnt);
        ......
        <span class="comment">// do something</span>
        ......
        <span class="comment">// 反序列化</span>
        <a class="code" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bc92914978fa2ad835fe250bbaad8c" title="根据树的序列进行反序列化为一个完整的树">treaplnk_deserialize</a>(&amp;r, buf, avl_cnt, DATA, node);
        <span class="comment">// 释放缓存</span>
        free(buf);
    }
</pre></div> </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad43d55a99cb69cce140b881eac510614" title="将树进行序列化为一个有序序列">treaplnk_serialize</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga69bc92914978fa2ad835fe250bbaad8c" title="根据树的序列进行反序列化为一个完整的树">treaplnk_deserialize</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00320">320</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga358134910aadd9d7580dbf0fed03bc31"></a><!-- doxytag: member="treaplnk.h::treaplnk_left" ref="ga358134910aadd9d7580dbf0fed03bc31" args="(treaplnk_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_left </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到左子节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">node</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回左子节点 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga055771881b33a6f1b5c69c8fd0177c1e" title="得到右子节点">treaplnk_right</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00332">332</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga055771881b33a6f1b5c69c8fd0177c1e"></a><!-- doxytag: member="treaplnk.h::treaplnk_right" ref="ga055771881b33a6f1b5c69c8fd0177c1e" args="(treaplnk_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_right </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到右子节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">node</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回右子节点 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga358134910aadd9d7580dbf0fed03bc31" title="得到左子节点">treaplnk_left</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00344">344</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gafd4f501b5392c966d7f7ccb6253ec465"></a><!-- doxytag: member="treaplnk.h::treaplnk_parent" ref="gafd4f501b5392c966d7f7ccb6253ec465" args="(treaplnk_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_parent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到父节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">node</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回父节点 </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00355">355</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga1f4ff7046c020cd7a83d88fc43f4da18"></a><!-- doxytag: member="treaplnk.h::treaplnk_priority" ref="ga1f4ff7046c020cd7a83d88fc43f4da18" args="(treaplnk_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline size_t treaplnk_priority </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到节点的优先权 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">node</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>uintptr_t 返回优先权 </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00366">366</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaeb5c0d6ab3522c1816b6834675be2828"></a><!-- doxytag: member="treaplnk.h::treaplnk_is_root" ref="gaeb5c0d6ab3522c1816b6834675be2828" args="(treaplnk_iter itr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline int treaplnk_is_root </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>itr</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断当前节点是否是根节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>是根节点 </td></tr>
    <tr><td class="paramname">0</td><td>不是根节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00379">379</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gae0ca77682f8559c79d5dc71bbc07756e"></a><!-- doxytag: member="treaplnk.h::treaplnk_is_leaf" ref="gae0ca77682f8559c79d5dc71bbc07756e" args="(treaplnk_iter itr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline int treaplnk_is_leaf </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>itr</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断当前节点是否是叶子节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>是叶子节点 </td></tr>
    <tr><td class="paramname">0</td><td>不是叶子节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00392">392</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga33f96e3db43b13c620d9ecf47be03418"></a><!-- doxytag: member="treaplnk.h::treaplnk_link" ref="ga33f96e3db43b13c620d9ecf47be03418" args="(treaplnk_iter newly, treaplnk_iter parent, treaplnk_iter *plink)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_link </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>newly</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> *&#160;</td>
          <td class="paramname"><em>plink</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>链接两个节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">newly</td><td>新节点 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">parent</td><td>父节点 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">plink</td><td>父节点对应孩子指针。若newly加入parent的左子，则plink指向 parent的left成员，若newly加入parent的右子，则plink指向 parent的right成员 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>链接newly和parent节点 </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00408">408</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaeb412c8138afd90d9d2e271b641c52ac"></a><!-- doxytag: member="treaplnk.h::treaplnk_set_priority" ref="gaeb412c8138afd90d9d2e271b641c52ac" args="(treaplnk_node *node, size_t priority)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_set_priority </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>priority</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>设置当前节点的优先权 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">node</td><td>当前节点 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">priority</td><td>新优先权 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00425">425</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga603045fe815f3b650f3086b3747bb6a9"></a><!-- doxytag: member="treaplnk.h::treaplnk_set_parent_if" ref="ga603045fe815f3b650f3086b3747bb6a9" args="(treaplnk_node *node, treaplnk_node *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_set_parent_if </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>parent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>仅在node不为空时，设置node的父节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">node</td><td>当前节点 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">parent</td><td>新的父节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00438">438</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gae3353c18c25b1b4c315a2407f2499b59"></a><!-- doxytag: member="treaplnk.h::treaplnk_node_init" ref="gae3353c18c25b1b4c315a2407f2499b59" args="(treaplnk_node *node)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_node_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_node</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>初始化节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">node</td><td>指定节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00450">450</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga10f0160bf916bb920848d908af696f17"></a><!-- doxytag: member="treaplnk.h::treaplnk_iter_replace" ref="ga10f0160bf916bb920848d908af696f17" args="(treaplnk_root *root, treaplnk_iter victim, treaplnk_iter newly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_iter_replace </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>victim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>newly</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>用新节点替换旧节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">victim</td><td>受害目标节点 </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">newly</td><td>新节点 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00466">466</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaf149eeeee5ce68eab7d07287ecc1f43b"></a><!-- doxytag: member="treaplnk.h::treaplnk_replace" ref="gaf149eeeee5ce68eab7d07287ecc1f43b" args="(treaplnk_root *victim, treaplnk_root *newly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_replace </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>victim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>newly</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>用新的树根替换旧树根 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">victim</td><td>受害目标树根 </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">newly</td><td>新树根 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00494">494</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gafd4471880ecdda0e76f9f6ca214805a6"></a><!-- doxytag: member="treaplnk.h::treaplnk_swap" ref="gafd4471880ecdda0e76f9f6ca214805a6" args="(treaplnk_root *a, treaplnk_root *b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_swap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>交换两个树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">a</td><td>第一个树 </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">b</td><td>第二个树 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00505">505</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga4cb4d2e7f6c2518f504eaee046450c4c"></a><!-- doxytag: member="treaplnk.h::treaplnk_exist" ref="ga4cb4d2e7f6c2518f504eaee046450c4c" args="(treaplnk_root *root, treaplnk_iter itr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API int treaplnk_exist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>itr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>判断一个节点是否存在于树中 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>指定节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>int 返回结果 </dd></dl>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>存在 </td></tr>
    <tr><td class="paramname">0</td><td>不存在 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00159">159</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga9961c3e28ad5d8bf2e1c599f0f0c0886"></a><!-- doxytag: member="treaplnk.h::treaplnk_at" ref="ga9961c3e28ad5d8bf2e1c599f0f0c0886" args="(treaplnk_root *root, size_t index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_at </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到正向索引对应的节点的迭代器 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>指定正向索引 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gae10f61d50563cd0731692ce8b1ab0cbb" title="得到逆向索引对应的节点的迭代器">treaplnk_reverse_at</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00530">530</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gae10f61d50563cd0731692ce8b1ab0cbb"></a><!-- doxytag: member="treaplnk.h::treaplnk_reverse_at" ref="gae10f61d50563cd0731692ce8b1ab0cbb" args="(treaplnk_root *root, size_t index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_reverse_at </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到逆向索引对应的节点的迭代器 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>指定逆向索引 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga9961c3e28ad5d8bf2e1c599f0f0c0886" title="得到正向索引对应的节点的迭代器">treaplnk_at</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00544">544</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga912adb278fdbb3938e29e0bcf2f58c6e"></a><!-- doxytag: member="treaplnk.h::treaplnk_front" ref="ga912adb278fdbb3938e29e0bcf2f58c6e" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_front </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到树的最左端节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2215902aa2d70496fccdb14fcf8da0ce" title="得到树的最右端节点">treaplnk_back</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00172">172</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga2215902aa2d70496fccdb14fcf8da0ce"></a><!-- doxytag: member="treaplnk.h::treaplnk_back" ref="ga2215902aa2d70496fccdb14fcf8da0ce" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_back </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到树的最右端节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga912adb278fdbb3938e29e0bcf2f58c6e" title="得到树的最左端节点">treaplnk_front</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00186">186</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaf5df84d890ae7dc07c210fead0d826ec"></a><!-- doxytag: member="treaplnk.h::treaplnk_begin" ref="gaf5df84d890ae7dc07c210fead0d826ec" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_begin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到指向正向起始位置的迭代器 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad590259a18b3e07fde596e1cd7dd135f" title="得到指向正向终止位置的迭代器">treaplnk_end</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12c517e1858f21365e26e5217ccb45af" title="得到当前迭代器的正向终止位置">treaplnk_end_of</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaaf3b3ffd977431ffbe9d7e24ee09e9e9" title="得到指向逆向起始位置的迭代器">treaplnk_rbegin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaab7748cacfeacd6f160350c2f37d89bf" title="得到指向逆向终止位置的迭代器">treaplnk_rend</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00574">574</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gad590259a18b3e07fde596e1cd7dd135f"></a><!-- doxytag: member="treaplnk.h::treaplnk_end" ref="gad590259a18b3e07fde596e1cd7dd135f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_end </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到指向正向终止位置的迭代器 </p>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器，永远返回NULL </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf5df84d890ae7dc07c210fead0d826ec" title="得到指向正向起始位置的迭代器">treaplnk_begin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12c517e1858f21365e26e5217ccb45af" title="得到当前迭代器的正向终止位置">treaplnk_end_of</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaaf3b3ffd977431ffbe9d7e24ee09e9e9" title="得到指向逆向起始位置的迭代器">treaplnk_rbegin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaab7748cacfeacd6f160350c2f37d89bf" title="得到指向逆向终止位置的迭代器">treaplnk_rend</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00585">585</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga12c517e1858f21365e26e5217ccb45af"></a><!-- doxytag: member="treaplnk.h::treaplnk_end_of" ref="ga12c517e1858f21365e26e5217ccb45af" args="(treaplnk_iter cur)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_end_of </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>cur</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到当前迭代器的正向终止位置 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>迭代器 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf5df84d890ae7dc07c210fead0d826ec" title="得到指向正向起始位置的迭代器">treaplnk_begin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad590259a18b3e07fde596e1cd7dd135f" title="得到指向正向终止位置的迭代器">treaplnk_end</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00597">597</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaaf3b3ffd977431ffbe9d7e24ee09e9e9"></a><!-- doxytag: member="treaplnk.h::treaplnk_rbegin" ref="gaaf3b3ffd977431ffbe9d7e24ee09e9e9" args="(treaplnk_root *root)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_rbegin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到指向逆向起始位置的迭代器 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">root</td><td>树根 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaab7748cacfeacd6f160350c2f37d89bf" title="得到指向逆向终止位置的迭代器">treaplnk_rend</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2a2dcd287fdd62bdd0d9cbbf60caeb60" title="得到当前迭代器的逆向终止位置">treaplnk_rend_of</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf5df84d890ae7dc07c210fead0d826ec" title="得到指向正向起始位置的迭代器">treaplnk_begin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad590259a18b3e07fde596e1cd7dd135f" title="得到指向正向终止位置的迭代器">treaplnk_end</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00609">609</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gaab7748cacfeacd6f160350c2f37d89bf"></a><!-- doxytag: member="treaplnk.h::treaplnk_rend" ref="gaab7748cacfeacd6f160350c2f37d89bf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_rend </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到指向逆向终止位置的迭代器 </p>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器，永远返回NULL </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaaf3b3ffd977431ffbe9d7e24ee09e9e9" title="得到指向逆向起始位置的迭代器">treaplnk_rbegin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga2a2dcd287fdd62bdd0d9cbbf60caeb60" title="得到当前迭代器的逆向终止位置">treaplnk_rend_of</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaf5df84d890ae7dc07c210fead0d826ec" title="得到指向正向起始位置的迭代器">treaplnk_begin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gad590259a18b3e07fde596e1cd7dd135f" title="得到指向正向终止位置的迭代器">treaplnk_end</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00620">620</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga2a2dcd287fdd62bdd0d9cbbf60caeb60"></a><!-- doxytag: member="treaplnk.h::treaplnk_rend_of" ref="ga2a2dcd287fdd62bdd0d9cbbf60caeb60" args="(treaplnk_iter cur)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_rend_of </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>cur</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到当前迭代器的逆向终止位置 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">itr</td><td>迭代器 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回迭代器 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaaf3b3ffd977431ffbe9d7e24ee09e9e9" title="得到指向逆向起始位置的迭代器">treaplnk_rbegin</a>, <a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gaab7748cacfeacd6f160350c2f37d89bf" title="得到指向逆向终止位置的迭代器">treaplnk_rend</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00632">632</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga4ef2c4a4f07589b1dae6b47c09ce790a"></a><!-- doxytag: member="treaplnk.h::treaplnk_next" ref="ga4ef2c4a4f07589b1dae6b47c09ce790a" args="(treaplnk_iter cur)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>cur</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到当前节点的中序后继节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cur</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回后继节点，若无后继，则返回NULL </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#gacdde57d39d567fc2b5dbc661f67bef08" title="得到当前节点的中序前驱节点">treaplnk_prev</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00200">200</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gacdde57d39d567fc2b5dbc661f67bef08"></a><!-- doxytag: member="treaplnk.h::treaplnk_prev" ref="gacdde57d39d567fc2b5dbc661f67bef08" args="(treaplnk_iter cur)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_prev </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>cur</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>得到当前节点的中序前驱节点 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cur</td><td>当前节点 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回前驱节点，若无前驱，则返回NULL </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga4ef2c4a4f07589b1dae6b47c09ce790a" title="得到当前节点的中序后继节点">treaplnk_next</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00220">220</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga71d356704e6ae0fd1b686ac10fce28eb"></a><!-- doxytag: member="treaplnk.h::treaplnk_advance" ref="ga71d356704e6ae0fd1b686ac10fce28eb" args="(treaplnk_iter cur, int dist)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API <a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a> treaplnk_advance </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct____treaplnk__node.html">treaplnk_iter</a>&#160;</td>
          <td class="paramname"><em>cur</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dist</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>给迭代器增加一段距离或减小一段距离 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cur</td><td>迭代器 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dist</td><td>增加的距离。正数时，表示增加；负数时，表示减小 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>treaplnk_iter 返回新迭代器 </dd></dl>

<p>在文件<a class="el" href="treaplnk_8c_source.html">treaplnk.c</a>第<a class="el" href="treaplnk_8c_source.html#l00147">147</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gadfbee5eebd305e1c30dcfc00b536dbfb"></a><!-- doxytag: member="treaplnk.h::treaplnk_clear" ref="gadfbee5eebd305e1c30dcfc00b536dbfb" args="(treaplnk_root *root, treaplnk_pr1 erase_handler)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void treaplnk_clear </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtreaplnk__root.html">treaplnk_root</a> *&#160;</td>
          <td class="paramname"><em>root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga12473c60d17919848883f04bfa09a5a5">treaplnk_pr1</a>&#160;</td>
          <td class="paramname"><em>erase_handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>清空树 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">root</td><td>树根 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">erase_handler</td><td>移除响应函数，通常用于监视和释放节点，可以传递NULL, 表示不为删除的节点调用响应来处理 </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>函数会为每一个被移除的节点调用erase_handler来处理节点 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group___xE6_xA0_x91_xE5_xA0_x86.html#ga0157ffea5e9b1a9d9bd903d8c6a518d8" title="移除区域内的节点">treaplnk_erases</a> </dd></dl>

<p>在文件<a class="el" href="treaplnk_8h_source.html">treaplnk.h</a>第<a class="el" href="treaplnk_8h_source.html#l00674">674</a>行定义。</p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:43 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
